package cn.geminis.cost.workflow.entity;

import cn.geminis.lowcode.annotation.*;
import jakarta.persistence.Column;
import jakarta.persistence.FetchType;
import jakarta.persistence.ManyToOne;
import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;
import java.time.LocalDateTime;

@Getter
@Setter
@UuidEntity
@QueryFilter
@CrudRepository
@CrudController
public class WorkflowCost {
    @ManyToOne(optional = false)
    @QueryFilterProperty(fieldName = "template.id", propertyName = "templateId", propertyType = "String")
    private WorkflowTemplate template;

    @Column(length = 128, nullable = false)
    @QueryFilterProperty
    private String processDefinitionId;

    @Column(length = 128, nullable = false)
    @QueryFilterProperty
    private String processDefinitionKey;

    @Column(length = 128, nullable = false)
    @QueryFilterProperty
    private String processInstanceId;

    @Column(length = 128, nullable = false)
    private String processName;

    @Column(length = 128)
    @QueryFilterProperty
    private String taskDefinitionId;

    @Column(length = 128)
    @QueryFilterProperty
    private String taskDefinitionKey;

    @Column(length = 128, nullable = false)
    @QueryFilterProperty
    private String taskInstanceId;

    @Column(length = 128, nullable = false)
    private String taskName;

    @Column(length = 64, nullable = false)
    private String username;

    @Column(nullable = false)
    private LocalDateTime startTime;

    @Column(nullable = false)
    private LocalDateTime endTime;

    @Column(nullable = false)
    private BigDecimal value;

}
